import requests
from script.get_user_info.name.nowcoder import nc_name
from script.get_contest_info.config.nowcoder_config import nc_headers ,  nc_time
def get_nc_ioi_response(contest_id , uid ):
    name = nc_name(uid)
    base_url = "https://ac.nowcoder.com/acm-heavy/acm/contest/real-time-rank-data"
    # 参数
    params = {
        "token": "",
        "id": contest_id,
        "searchUserName": name ,  # 对中文进行编码
        "limit": 0,"contestList" : [str(contest_id)],
        "_": nc_time
    }
    response = requests.get(base_url, params=params , headers=nc_headers)
    return response.text
if __name__ == '__main__':
    print(get_nc_ioi_response(52244, "961118220"))

